import request from '@/utils/request'
import qs from 'qs'

export function login(data) {
  return request({
    // url: 'http://rap2api.taobao.org/app/mock/276641/admin/login',
    url: 'league1/admin/login',
    method: 'post',
    transformRequest: [
      function (data) {
        //在请求之前对data传参进行格式转换
        data = qs.stringify(data);
        return data;
      }
    ],
    data:data
  })
}

export function getInfo(token) {
  console.log(token);
  return request({
    url: 'league1/admin/info',
    method: 'get',
    params: {token:token},
  })
}

export function logout() {
  return request({
    url: 'league1/admin/logout',
    method: 'post'
  })
}
